<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="password-Type" password="text/html; charset=UTF-8">
    <title>陪护预览</title>
    <link
            href="${pageContext.request.contextPath}/css/bootstrap.min.css?v=3.3.5"
            rel="stylesheet">
    <link
            href="${pageContext.request.contextPath}/css/font-awesome.min.css?v=4.4.0"
            rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/custom.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/animate.min.css"
          rel="stylesheet">
    <link
            href="${pageContext.request.contextPath}/css/style.min.css?v=4.0.0"
            rel="stylesheet">
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
    <style type="text/css">
        label {
            display: inline-block;
            padding: 0 10px;
            vertical-align: middle;
        }

        input {
            outline: none;
            border: 1px solid rgb(216, 216, 216);
            padding: 2px 10px 2px 10px;
        }

        input[type="text"], input[type="password"] {
            height: 30px;
            line-height: 30px;
            border-radius: 5px;
            padding: 0px 10px;
            vertical-align: middle;
            color: #666;
        }

        input[type="button"] {
            padding: 0px 10px;
            height: 40px;
        }

        .form-group {
            vertical-align: middle;
            padding: 10px 10px;
        }

        .text-center-1 {
            text-align: right;
        }

        .loginscreen.middle-box {
            width: 600px;
        }
    </style>

    <script type="text/javascript">
        $(document).ready(function () {
            $(".i-checks").iCheck({
                checkboxClass: "icheckbox_square-green",
                radioClass: "iradio_square-green",
            });
        });
    </script>
    <script type="text/javascript">
        function deletefun(id, newName) {
            if (confirm("确定要导出excel表?")) {
                window.location.href = "${pageContext.request.contextPath}/servlet/PeihuServlet?path=dc";
            }
        }

        function deletefun1(id, newName) {
            if (confirm("确定要导入excel表?")) {
                window.location.href = "${pageContext.request.contextPath}/servlet/PeihuServlet?path=dr";
            }
        }
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            dayin();
        });

        function dayin() {
            bdhtml = window.document.body.innerHTML;//获取当前页的html代码
            sprnstr = "<!--startprint-->";//设置打印开始区域
            eprnstr = "<!--endprint-->";//设置打印结束区域
            prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 0); //从开始代码向后取html
            prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));//从结束代码向前取html
            window.document.body.innerHTML = prnhtml;
            window.print();
        }
    </script>
</head>

<body class="gray-bg">
<!--startprint-->
<h1>陪护预览</h1>
<br/>

<form method="post"
      action="${pageContext.request.contextPath }/Peihu/page2/${User.id}"
      onsubmit="return validate()">
    <div class="form-group">
        <label for="" class="col-sm-4 control-label">陪护名称</label>
        <div class="col-sm-8">
            <input type="text" class="form-control" id=""
                   name="name" value="">
        </div>
        <label for="" id="realname_prompt"
               class="col-sm-12 control-label text-center-1"></label>
    </div>
    <br/>
    <div class="form-group">
        <input type="submit" class="btn btn-primary block full-width m-b"
               value="查询"/>
    </div>
</form>


<table style="margin:0 auto;" class="display table table-bordered table-striped"
       id="dynamic-table">
    <tr>
        <td>编号</td>
        <td>家属名称</td>
        <td>活动名称</td>
        <td>陪护时间</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${pageUtil.getList() }" var="p">
        <tr>
            <td>${p.id }</td>
            <td>${p.jsname }</td>
            <td>${p.hdname }</td>
            <td>${p.enddate }</td>
            <td align="center" style="width:200px">
                <a href="${pageContext.request.contextPath}/Peihu/delete/${p.id}">
                    <button class="btn btn-default" onclick="">删除</button>
                </a>
            </td>
        </tr>
    </c:forEach>
</table>
<br/>
<input type="submit" class="btn btn-primary block full-width m-b"
       value="陪护管理操作列表"/>
<br/><br/>
<table style="width:100%">
    <tr>
        <td align="center">
            <b>共${pageUtil.pageNumber}</b>条&nbsp;&nbsp;&nbsp;&nbsp;
            当前第<span>${pageUtil.pageIndex}</span>页&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="${pageContext.request.contextPath}/Peihu/page2/${User.id}?pageIndex=1" class='first'>首页</a>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <a href="${pageContext.request.contextPath}/Peihu/page2/${User.id}?pageIndex=${pageUtil.pageIndex>1?pageUtil.pageIndex-1:1}"
               class='pre'>上一页</a>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <c:forEach begin="1" end="${pageUtil.pageCount}" var="i">
                <a href="${pageContext.request.contextPath}/Peihu/page2/${User.id}?pageIndex=${i}"
                   style="text-decoration: none;">${i}</a>
                &nbsp;&nbsp;&nbsp;&nbsp;
            </c:forEach>
            <a href="${pageContext.request.contextPath}/Peihu/page2/${User.id}?pageIndex=${pageUtil.pageIndex<pageUtil.pageCount?pageUtil.pageIndex+1:pageUtil.pageCount}"
               class='next'>下一页</a>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <a href="${pageContext.request.contextPath}/Peihu/page2/${User.id}?pageIndex=${pageUtil.pageCount}"
               class='last'>末页</a>


        </td>
    </tr>
</table>
<br/><br/>
<br/><br/>
<br/><br/>
</body>


</html>